﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using crm_dal.Objects;
using crm_library.Extenstions;

namespace crm_web.DataPages
{
    public partial class EditContact : System.Web.UI.Page
    {
        Contact displayContact;

        protected void Page_Init(object sender, EventArgs e)
        {
            displayContact = new Contact(Convert.ToInt32(HttpContext.Current.Session["Selection"]));
            txtContactID.Text = displayContact.ContactID.ToString();
            txtClientID.Text = displayContact.ClientID.ToString();
            txtUserID.Text = displayContact.UserID.ToString();
            txtContactType.Text = displayContact.TypeStr;

        }

        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            
            displayContact.ClientID = Convert.ToInt32(txtClientID);
            displayContact.UserID = Convert.ToInt32(txtUserID);
            //displayContact.TypeStr = txtContactType.Text.Trim();
            displayContact.Update();
        }
    }
}